﻿using System;

class SquareRootException
{
    static void Main()
    {
        Console.Write("Enter a number: ");

        try
        {
            int number = int.Parse(Console.ReadLine());

            if (number < 0)
            {
                Console.WriteLine("Invalid number!");
            }
            else
            {
                Console.WriteLine("Square root of {0} is: {1}", number, number * number);
            }            
        }

        catch (FormatException)
        {
            Console.Error.WriteLine("Invalid number");
        }

        catch (OverflowException)
        {
            Console.Error.WriteLine("Invalid number");
        }

        catch (ArgumentNullException)
        {
            Console.Error.WriteLine("Invalid number");
        }

        finally
        {
            Console.WriteLine("Good bye!");
        }
    }
}
